<?php

namespace app\mall\ui\table;

use suframe\thinkAdmin\ui\table\TableInterface;

/**
 * 地区设置表格
 */
class MallRegionTable extends TableInterface
{
    public function header()
    {
        return [
            'id' => ['label' => 'ID', 'sort' => true, 'fixed' => 'left', 'width' => 80],
            'name' => ['label' => '地区名称'],
            'has_child'=> ['label' => '子地区', 'type' => 'link', 'linkConfig'  => [
                    ['key' => 'has_child', 'value' => true, 'showValue' => false, 'label' => '管理子地区', 'icon' => 'fa fa-level-down', 'url' => '/mall/admin/mallRegion', 'vars' =>['id@parent_id']],
                ]
            ],
        ];
    }

    public function filters()
    {
        return [
            'name' => ['label' => '地区名称', 'type' => 'text'],
        ];
    }
}